<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<#include "lib/lib.html" />
<title>评论管理</title>
</head>
<body>
	<nav class="breadcrumb">
	 	 <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 评论管理 <span class="c-gray en">&gt;</span> 评论列表
		 <a  class="btn btn-success radius r mr-20"  style="line-height: 1.6em; margin-top: 3px" href="javascript:location.replace(location.href);" title="刷新">
		 <i class="Hui-iconfont">&#xe68f;</i></a>
	</nav>
	<div class="pd-20 text-c">
		<div class="text-c">
			<form action="${basePath}/comment/list.do">
				<input type="text" name="userNick" id="userNick" placeholder="用户昵称" value='${map.userNick}' style="width: 250px" class="input-text">
				<input type="text" name="userMobile" id="userMobile" placeholder="用户手机号" value='${map.userMobile}' style="width: 250px" class="input-text">
				<input type="text" name="orderId" id="orderId" placeholder="订单ID" value='${map.orderId}' style="width: 250px" class="input-text">
				<button name="" id="" class="btn btn-success" type="submit"> <i class="Hui-iconfont">&#xe665;</i> 搜索 </button>
			</form>
		</div>
		<div class="cl pd-5 bg-1 bk-gray mt-20">
			<span class="l">
				<a class="btn btn-primary radius" onclick="adm_add()" href="javascript:;">
				<i class="Hui-iconfont">&#xe600;</i> 批量回复</a></span> <span class="r"> 
			</span>
		</div>
		<div class="mt-20">
			<div id="page" class="holder"></div>  
			<table class="table table-border table-bordered table-hover table-bg table-sort">
				<thead>
					<tr class="text-c">
						<th width="40"><input type="checkbox" value=""></th>
						<th>ID</th>
						<th>订单ID</th>
						<th>用户ID</th>
						<th>用户昵称</th>
						<th>用户手机号</th>
						<th>回复条数</th>
						<th>评论描述</th>
						<th>图片</th>
						<th width="150">创建时间</th>
						<th width="150">操作</th>
					</tr>
				</thead>
				<tbody>
					<#if list.dataList?? && list.dataList?size gt 0>
					<#list list.dataList as dl >
						<tr class="text-c">
							<td><input type="checkbox" name="checkId" value="${dl.id!}"></td>
							<td>${dl.id!}</td>
							<td>${dl.orderId!}</td>
							<td>${dl.userId!}</td>
							<td>${dl.userNick!}</td>
							<td>${dl.userMobile!}</td>
							<td>${dl.commentCount!}</td>
							<td>${dl.descs!}</td>
							<td><img alt="" src="${dl.images!}"> </td>
							<td>${dl.createTime?string('yyyy-MM-dd')}</td>
							<td class="td-manage">
								<a title="回复" href="javascript:;" onclick="adm_edit('回复','${basePath}/comment/goAdd.do?id=${dl.id!}','800','500')" class="ml-5" style="text-decoration:none">回复</a>
								<#if dl.commentCount != 0>
									<a title="查询回复" href="javascript:;" onclick="show(${dl.id})" class="ml-5" style="text-decoration:none">查看回复</a>
								</#if>
							</td> 
						</tr>
					</#list>
					</#if>
				</tbody>
			</table>
			</br>
			<div class="page_list"></div>
		</div>
	</div>
	<script type="text/javascript">
	$(function(){
	 	laypage({
	 	    cont: $('.page_list'), //容器。值支持id名、原生dom对象，jquery对象,
		    pages: ${list.endPage! }, //总页数
	 	    //skip: true, //是否开启跳页
// 	    	skin: 'molv',
	 	    groups: 10, //连续显示分页数
	 	    first: '首页', //若不显示，设置false即可
	 	    last: '尾页', //若不显示，设置false即可
	 	    curr:${list.curPage!},
	 	   	hash: true, //开启hash
	 	    skin: '#00AA91',
	 	    jump: function(obj,first){ //触发分页后的回调
// 	 	       $('.view').html('目前正在第'+ obj.curr +'页，一共有：'+ obj.pages +'页');
	 	    	if(!first){
	 	         	 window.location.href="${basePath}/comment/list.do?curPage="+obj.curr +"&pageData="+10;
	 	    	}
	 	    }
	 	});
	 			
	});
	//添加
	function adm_add() {
		 var text = $("input:checkbox[name='checkId']:checked").map(function(index,elem) {
	            return $(elem).val();
	        }).get().join(',');
		if(text==""){
			layer.msg('请选择要回复的评论!', {
				icon : 1,
				time : 1500
			});
			return ;
		}
		
		layer_show("回复", "${basePath}/comment/goAdd.do?id="+text, 800, 500);
	}
	//编辑
	function adm_edit(title, url, w, h){
		layer_show(title, url, w, h);
	}
	//查看
	function show(id){
		window.location.href="${basePath}/comment/findComment.do?id=" + id;
	}
	</script>
</body>
</html>